-
-
Notifications
You must be signed in to change notification settings - Fork 215
Add i18n support for response message #753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
针对错误信息目前看起来不错,但功能需要进行打磨,请先不要合并,我会稍后更新这个
这个pr只是一个参考,应该还不是最优解,比如翻译t方法缺少ide提示 |
@downdawn 我已经准备好了,如果没有问题,让我们合并它 |
这个改版有点大,我们是否要考虑一下做分支,或者发起投票征求一下意见 |
这个 PR 目前是向后兼容的,理论上没有什么问题,我的想法是在本周的 v1.8.0 版本中提供 稍后我在 dis 上面发个投票看看 |
我们暂时先不要合并,等待社区反馈结果 |
大佬,我问下,这个国际化是后端国际化,还是前端国际化? |
@dk19930125 针对后端的,不过用法跟前端几乎一样 这个就是为了同步前端国际化,前端在页面切换语言的同时,后端返回的响应消息也会同步切换语言 |
这样感觉不是很冗余吗 |
看场景,通常情况下,一个系统只会内置一种特定语言 如果你们是一个国内公司,但提供国际服务,这些国际用户并不懂中文,但他们使用你们系统遇到问题时,系统却提示了中文,前端的国际化只是针对页面展示的,并不会处理接口返回,此时后端 i18n 将发挥作用 如果你们只是一个普通的国内服务商,那显然 i18n 没有任何用处 |
@downdawn 我今晚会在 discord 提前结束投票 鉴于当前投票结果,我建议我们仅保留 i18n 最小实施,翻译部分将包括: |
👌合理的 |
* feat: i18n support * Optimize i18n * Update the locale in the code * Update the zh-CN file * Update the en-US file * Update the reload filter * Update locale success plugin value * Fix lint * Update pydantic error message translation * Update to minimal implementation * Fix minimal missing code
close #752